/**
 * Copyright 2019 asiainfo Inc.
 **/
package com.myz.rabbitmq.rpc;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author maoyz0621 on 19-1-16
 * @version: v1.0
 */
public class RpcTest {

    // 测试线程池
    protected static ExecutorService executorService = Executors.newFixedThreadPool(10);

    public static void main(String[] args) throws Exception {
        // rpc服务端
        executorService.submit(() -> {
            try {
                RpcServer.execute();
            } catch (Exception e) {
                e.printStackTrace();
            }
        });

        // rpc客户端
        executorService.submit(() -> {
            try {
                RpcClient.execute("rpc test");
            } catch (Exception e) {
                e.printStackTrace();
            }
        });

        // sleep 10s
        Thread.sleep(10 * 1000);

    }
}
